package dao.impl.jpa;

import java.util.List;

import dao.PersoonDAO;
import domain.Persoon;

public class PersoonDAOImpl extends BasePersistence implements PersoonDAO {

	@SuppressWarnings("unchecked")
	@Override
	public List<Persoon> findByName(String type, String naam) {
        open();
        List<Persoon> set = em.createNamedQuery("Persoon.findByName").setParameter("type", type).setParameter("naam", naam).getResultList();
        close();
		return set;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Persoon> findByType(String type) {
        open();
        List<Persoon> set = em.createNamedQuery("Persoon.findByType").setParameter("type", type).getResultList();
        close();
		return set;
	}
}
